package com.yiren.manager.ctrl.view;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yiren.core.exception.MyException;
import com.yiren.core.repository.utils.QueryResult;
import com.yiren.core.utils.HTTPResult;
import com.yiren.entity.ViewBeHospitalExpireRemind;
import com.yiren.manager.service.iface.view.ViewBeHospitalExpireRemindService;

@RequestMapping("viewBeHospitalExpireRemind")
@Controller
public class ViewBeHospitalExpireRemindController {

	@Autowired
	private ViewBeHospitalExpireRemindService selfService;
	
	@RequestMapping("findAll")
	@ResponseBody
	public HTTPResult<ViewBeHospitalExpireRemind> findAll() throws MyException{
		HTTPResult<ViewBeHospitalExpireRemind> result = new HTTPResult<ViewBeHospitalExpireRemind>();
		
		String sqlWhere = "date_dis<=15";
		
		QueryResult<ViewBeHospitalExpireRemind> qr = selfService.find(ViewBeHospitalExpireRemind.class, sqlWhere, new Object[]{});
		
		result.setData(qr.getResultList());
		
		return result;
	}
}
